package com.egg.auth.entity.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.egg.common.core.model.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户账号表
 * </p>
 *
 * @author east
 * @since 2021-07-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "auth_user_account")
@ApiModel(value = "UserAccount对象", description = "用户账号表")
public class UserAccount extends BaseEntity {


    @ApiModelProperty(value = "用户ID")
    @TableField(value = "user_id")
    private Long userId;

    @ApiModelProperty(value = "账号类型", notes = "com.egg.auth.enums.account.AccountTypeEnum")
    @TableField(value = "account_type")
    private String accountType;

    /**
     * 根据 accountType 类型决定储存值
     * 密码: 账号
     * 微信: 微信openid
     */
    @ApiModelProperty(value = "用户名")
    @TableField(value = "username")
    private String username;

    @ApiModelProperty(value = "密码")
    @TableField(value = "password")
    private String password;

    @ApiModelProperty(value = "状态", notes = "com.egg.auth.enums.account.AccountStateEnum")
    @TableField(value = "state")
    private String state;


}
